---
title: SAIF.Application.Claim.Legal operations and processes
summary: Business and technical operations supported by the Legal-claim application (AppManager) tier.
status: draft
owner: SAIF Documentation Pipeline
last_reviewed: 2026-08-25
library: SAIF.Application.Claim.Legal
reference_type: embedded
---

# SAIF.Application.Claim.Legal operations and processes

This page is the operation catalog and cross-operation hub for `SAIF.Application.Claim.Legal`. Each operation's detailed, step-by-step logic lives in its own page under `operations/`.

## Operation catalog
| Operation | Intent | Trigger | Inputs | Outputs | Rules | Tables | SQL |
| --- | --- | --- | --- | --- | --- | --- | --- |
| [Create/select legal case context](operations/create-select-legal-case-context.md) | Establish the active legal case for a manager instance (existing or new) before any screen data is exposed. | Web tier sets a context/claim number, or requests a new case. | `ContextNumber`/claim ID, `SecurityPrincipal` | `CurrentCase` (`clsLegalCase`), case header (`clsLegalData`), `m_CanViewClaim`/`Message` | [BR-LGL-001](business-rules.md#br-lgl-001-admin-group-bypasses-claim-conflict-and-exposure-checks), [BR-LGL-002](business-rules.md#br-lgl-002-worker-conflict-claims-require-conflict-and-exposure-access), [BR-LGL-003](business-rules.md#br-lgl-003-exposure-flagged-claims-require-exposure-access) | — | [SQL-012](sql/SQL-012-get-legal-case-header.md) |
| [Insert letter request](operations/insert-letter-request.md) | Create a pending letter-request record and obtain its generated sequence number. | Called by Print DEF letter or Save hearing request/update case (recon request). | Letter type code, case/claim IDs, hold date, create user | `requestNum` (generated sequence number) | — | — | [SQL-001](sql/SQL-001-insert-letter-request.md) |
| [Print DEF letter](operations/print-def-letter.md) | Generate and queue the Defense Evaluation Form letter and mark the case DEF-sent. | Save flow with `sendDEF = True`, or popup-triggered print. | `CurrentCase`, computed hold date | Letter request; `DefSentDate`/`SendDefFlag` updates | [BR-LGL-004](business-rules.md#br-lgl-004-printing-a-def-letter-marks-the-case-def-sent) | — | [SQL-001](sql/SQL-001-insert-letter-request.md) |
| [Send DEF email reminder](operations/send-def-email-reminder.md) | Email the assigned attorney's manager a DEF reminder, redirected outside Production. | Triggered after `PrintDEF`/schedule save, when a DEF email is due. | Assigned attorney ID, environment | Reminder email; `SendDefFlag` reset | [BR-LGL-005](business-rules.md#br-lgl-005-non-production-def-email-reminders-are-redirected-to-the-current-user) | — | [SQL-020](sql/SQL-020-get-attorney-manager-email.md) |
| [Run attorney assignment batch process](operations/run-attorney-assignment-batch-process.md) | Execute the attorney-assignment batch algorithm and surface its results. | `clsAssignmentManager.RunAssignmentProcess()` invoked (batch UI/job). | Environment (Testing flag) | `AssignmentList`/`AssignmentDetail` | [BR-LGL-006](business-rules.md#br-lgl-006-attorney-assignment-batch-process-runs-in-testing-mode-outside-production) | — | — |
| [Sync hearing schedule to Guidewire](operations/sync-hearing-schedule-to-guidewire.md) | Push matter/activity updates for a hearing schedule to the Guidewire claim system. | Schedule save (`clsScheduleManager`/`clsAssignmentManager`). | `clsLegalSchedule` | Guidewire matter/activity record (external) | [BR-LGL-007](business-rules.md#br-lgl-007-hearing-schedule-sync-to-guidewire-requires-an-assigned-attorney), [BR-LGL-008](business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save) | — | — |
| [Sync WCD number to Guidewire](operations/sync-wcd-number-to-guidewire.md) | Push an updated WCD number to the Guidewire claim system. | Case save when `m_WCDNum` was supplied (`clsRequestManager.OnWrite`). | WCD number, WCD user | Guidewire claim WCD-number update (external) | [BR-LGL-008](business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save) | — | — |
| [Save hearing request / update case](operations/save-hearing-request-update-case.md) | Persist a hearing-request case, including audit notes and consolidation handling. | `clsRequestManager.OnWrite` (case Save). | `CurrentCase`, prior firm/attorney IDs | Saved case; audit case notes; recon letter request | [BR-LGL-009](business-rules.md#br-lgl-009-worker-attorney-firm-change-creates-a-system-audit-case-note), [BR-LGL-010](business-rules.md#br-lgl-010-worker-attorney-change-creates-a-system-audit-case-note), [BR-LGL-011](business-rules.md#br-lgl-011-consolidation-is-rejected-when-a-hearing-is-scheduled-in-the-past-for-a-set-reset-case), [BR-LGL-008](business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save) | — | [SQL-001](sql/SQL-001-insert-letter-request.md) |
| [Submit letter print batch job](operations/submit-letter-print-batch-job.md) | Submit an Appworx batch print job for queued letter requests. | `clsCreateFileManager.PrintLetters`, `clsMailDateManager.PrintCoverLetters`, or `clsRequestManager.OnWrite`. | Updated case sequence numbers, printer, user ID | Appworx batch job submission (external) | — | — | — |
| [Consolidated-case propagation](operations/consolidated-case-propagation.md) | Mirror the primary case's status/LCE/file-location/DEF-sent state onto its secondary consolidated cases. | Save of the primary case. | `CurrentCase.Consolidations` | Updated, saved secondary `clsLegalCase` records | [BR-LGL-012](business-rules.md#br-lgl-012-secondary-consolidated-cases-mirror-the-primary-case-state) | — | — |
| [Delete case note](operations/delete-case-note.md) | Remove a case note, subject to role and note-origin restrictions. | `clsCaseNotesManager.DeleteNote()` invoked. | Note ID, caller role | Note removed, or blocked with an error message | [BR-LGL-013](business-rules.md#br-lgl-013-case-note-deletion-is-restricted-by-role-and-note-origin), [BR-LGL-014](business-rules.md#br-lgl-014-case-note-view-update-access-is-restricted-by-security-key) | — | — |
| [Delete hearing location](operations/delete-hearing-location.md) | Remove a hearing location that is not currently in use. | `clsHearingLocationManager.DeleteLocation()` invoked. | Location code | Location removed, or blocked with an error message | [BR-LGL-015](business-rules.md#br-lgl-015-a-hearing-location-cannot-be-deleted-while-in-use) | [HEARING_LOCATION_CODE](database-tables.md#hearing_location_code) | [SQL-011](sql/SQL-011-location-code-list-hearing-location.md) |
| [Delete legal person](operations/delete-legal-person.md) | Remove a legal person/other-firm entry that is not currently in use. | `clsLegalPersonManager.DeletePerson()` invoked. | Person ID | Person removed, or blocked with an error message | [BR-LGL-016](business-rules.md#br-lgl-016-a-legal-person-cannot-be-deleted-while-in-use) | [LEGAL_PERSON_TYPE_CODE](database-tables.md#legal_person_type_code) | [SQL-015](sql/SQL-015-person-type-list.md) |
| [Delete schedule row](operations/delete-schedule-row.md) | Remove a hearing schedule row while it is in Cancelled status. | `clsScheduleManager.DeleteSchedule()` invoked. | Schedule row ID | Row removed, or blocked with an error message | [BR-LGL-017](business-rules.md#br-lgl-017-a-schedule-row-can-only-be-deleted-while-cancelled) | — | — |

<!--
  STRICT: The Operation name in each catalog row MUST link to that operation's
  detail page at operations/<operation-slug>.md (never an on-page anchor). The
  step-by-step logic, per-step rule/SQL citations, and embedded dependency logic
  live in the per-operation document (see templates/operation-document.md), not
  on this hub page. The Rules column lists the primary business rules the
  operation enforces, each as a link to business-rules.md.
-->

## Process flow diagram
The following diagram visualizes the primary control/data flow from the web tier through this library to the business tier, Oracle, and the Guidewire integration boundary.

```mermaid
flowchart TD
	UI[Legal web UI] --> Mgr[SAIF.Application.Claim.Legal<br>manager New/OnContextChanged/OnRetrieve]
	Mgr --> Biz[SAIF.Business.Claim.Legal<br>business objects Get*/New*/Save]
	Biz --> DPI[BOF data portal<br>IDataPortalInfo]
	DPI --> Ora[(Oracle<br>pk80001_LEGALNET / pk80001_legalNet)]
	Mgr --> AppSql[Application-layer SQL<br>code-table lookups]
	AppSql --> Ora
	Mgr -->|REST boundary| Gw[Guidewire claim system<br>GwMatterApi / GWActivityData / GWClaimDataApi]
	Mgr -->|batch print| Appworx[SAIF.Services.Appworx<br>SubmitBatchJob]
```

## Inherited operations and processes

Operations in this section originate from `clsBusinessBase` (`SAIF.Framework.Core`), the base class inherited transitively by every concrete manager (via `AppManagerBase`/`ClaimAppManager`) and directly by `clsLegalData`. They are inherited framework lifecycle operations, not implemented in this library.

### From `clsBusinessBase` (`SAIF.Framework.Core`)

| Operation | Intent | Provided by | Origin | Embedded in |
| --- | --- | --- | --- | --- |
| Manage edit session | Open, commit, or roll back an in-memory editing scope for a business object or collection graph, including children.† | `BeginEdit`/`CancelEdit`/`ApplyEdit` | `SAIF.Framework.Core` | All manager operations above (inherited lifecycle, not directly invoked by this library's own code)* |
| Evaluate business object rules | Run registered rules in severity order and refresh broken-rule state.† | `Rules` (`clsRulesManager`) | `SAIF.Framework.Core` | All manager operations above (inherited lifecycle, not directly invoked by this library's own code)* |
| Save business object | Validate a root or child business object and dispatch the correct delete, insert, or update path based on state flags.† | Inherited `Save()`/`SaveChild()` | `SAIF.Framework.Core` | [Save hearing request / update case](operations/save-hearing-request-update-case.md), [Consolidated-case propagation](operations/consolidated-case-propagation.md) |
| Create/Retrieve lifecycle operations | Create or retrieve a business object through the data-portal dispatch path.† | Inherited `OnRetrieve`/data-portal dispatch | `SAIF.Framework.Core` | [Create/select legal case context](operations/create-select-legal-case-context.md) |
| Execute data-portal request | Turn scalar/result-set/sequence/XML requests into portal requests and dispatch them.† | `IDataPortalInfo`/`SqlHelper` (via inherited data-portal plumbing) | `SAIF.Framework.Core` | [Create/select legal case context](operations/create-select-legal-case-context.md), [Insert letter request](operations/insert-letter-request.md) |

> **Origin**: These operations are defined in `SAIF.Framework.Core` / `clsBusinessBase` and inherited by every concrete manager and by `clsLegalData`. `Save()`/`SaveChild()` throw `ApplicationException` if the target is read-only, in the wrong root/child role, still inside an edit level, or invalid after rule evaluation† — no direct evidence in this library's own source shows these inherited members being invoked; managers instead rely on `LegalManagerBase`'s own parallel `OnInitialize`/`OnRetrieve`/`OnWrite` lifecycle contract*.

## Database interactions

The following table summarizes which operations read from or write to the database. Per-step SQL and table citations live in each operation's detail page under `operations/`.

| Operation | SQL | Tables | Type |
| --- | --- | --- | --- |
| [Create/select legal case context](operations/create-select-legal-case-context.md) | [SQL-012](sql/SQL-012-get-legal-case-header.md) | — (stored-procedure result set) | Read |
| [Insert letter request](operations/insert-letter-request.md) | [SQL-001](sql/SQL-001-insert-letter-request.md) | — (stored-procedure execute) | Write |
| [Print DEF letter](operations/print-def-letter.md) | [SQL-001](sql/SQL-001-insert-letter-request.md) | — (stored-procedure execute) | Write |
| [Send DEF email reminder](operations/send-def-email-reminder.md) | [SQL-020](sql/SQL-020-get-attorney-manager-email.md) | [DUAL](database-tables.md#dual) | Read |
| [Save hearing request / update case](operations/save-hearing-request-update-case.md) | [SQL-001](sql/SQL-001-insert-letter-request.md) | — (stored-procedure execute) | Write |
| [Delete hearing location](operations/delete-hearing-location.md) | [SQL-011](sql/SQL-011-location-code-list-hearing-location.md) | [HEARING_LOCATION_CODE](database-tables.md#hearing_location_code) | Read |
| [Delete legal person](operations/delete-legal-person.md) | [SQL-015](sql/SQL-015-person-type-list.md) | [LEGAL_PERSON_TYPE_CODE](database-tables.md#legal_person_type_code) | Read |

## Failure and edge-case behavior
- Guidewire/WCD integration failures ([BR-LGL-008](business-rules.md#br-lgl-008-guidewire-and-wcd-integration-failures-never-fail-the-case-save)) are logged but never fail the underlying case save.
- A consolidation change that would consolidate a case with a past-dated hearing in Set/Reset status is rejected with a user-facing message ([BR-LGL-011](business-rules.md#br-lgl-011-consolidation-is-rejected-when-a-hearing-is-scheduled-in-the-past-for-a-set-reset-case)); other consolidation exception messages are rethrown unhandled.
- Deletion operations (case note, hearing location, legal person, schedule row) are blocked with a user-facing error rather than throwing when their respective business rule is not satisfied.

## Stored procedure operations

Retrieved Oracle source confirms that `WCIS_DBA.Pk80001_Legalnet` exists. The following rows summarize the package operations relevant to this library's direct application-layer calls.

| Operation | Description | Source | Link |
| --- | --- | --- | --- |
| `insertLetterRequest` | Allocates `LETTER_REQUEST_SEQ.NEXTVAL`, inserts the `LETTER_REQUEST` row, and stamps `CREATE_DATE = SYSDATE`. | `LegalManagerBase.insertLetterRequest` ([SQL-001](sql/SQL-001-insert-letter-request.md)) | [Details](procedures/pk80001-legalnet.md#insertletterrequest) |
| `getHeader*` | This library calls `pk80001_legalNet.getHeader`, but the retrieved package exposes the matching header behavior through `getLegalCase`, `get_case_num`, `get_asgn_atty`, and `get_hearing_date`* | `clsLegalData.New` ([SQL-012](sql/SQL-012-get-legal-case-header.md)) | [Details](procedures/pk80001-legalnet.md#getheader-inferred-mapping) |
| `get_atty_mngr_email` | Resolves the assigned attorney manager email from the most recent hearing, with outside-counsel fallback and `NONE` sentinel return. | `clsScheduleManager.getAttyMngrEmail` ([SQL-020](sql/SQL-020-get-attorney-manager-email.md)) | [Details](procedures/pk80001-legalnet.md#get_atty_mngr_email) |

## Related documentation
- [Index](index.md)
- [Overview](overview.md)
- [Architecture](architecture.md)
- [Dependencies](dependencies.md)
- [Business rules](business-rules.md)
- [Database tables](database-tables.md)
- [SQL catalog](sql/index.md)
- [API reference](api/index.md)

> **Note:** Statements marked with `†` are derived from dependency library
> documentation via the Legends CLI. Statements marked with `*` were inferred
> from code structure or contextual evidence.

## Sources
- Oracle source retrieval: `C:\Users\chrfre\AppData\Local\Temp\oracle-sources\pk80001_legalnet.json`
- `SAIF.Application.Claim.Legal\LegalManagerBase.vb`
- `SAIF.Application.Claim.Legal\clsLegalData.vb`
- `SAIF.Application.Claim.Legal\clsHearingLocationManager.vb`
- `SAIF.Application.Claim.Legal\clsLegalPersonManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsScheduleManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsAssignmentManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsRequestManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsCaseNotesManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsCreateFileManager.vb`
- `SAIF.Application.Claim.Legal\LegalNet\clsMailDateManager.vb`
